import os

# region #定义文件路径
RootPath = os.path.abspath('.')  # current dir

BlockDir = RootPath + '/block'  # block file directory
if not os.path.exists(BlockDir):
    os.makedirs(BlockDir)    

DbBaseDir = RootPath + '/BlockDb'  # block database file directory
if not os.path.exists(DbBaseDir):
    os.makedirs(DbBaseDir)    

BlockDbFileName = DbBaseDir+'/BlockDb.db'    # 区块数据库文件名
ServerDbFilename = DbBaseDir+'/ServerUseDb.db'    # Server用数据库文件名
ClientDbFilename = DbBaseDir+'/ClientUseDb.db'    # Client用数据库文件名
SimDbFilename = DbBaseDir+'/Sim.db'    # 用于电网快速检索仿真的数据库

# endregion

def FilterInput(strInput=''):  # 对cmd输入的命令进行过滤
    outputStr = strInput.replace("\t", " ")  # 替换table键为空格
    outputStr = outputStr.replace("\n", " ")  # 替换enter键为空格
    outputStr = outputStr.replace('  ', ' ')  # 两个空格替换为一个空格
    outputStr = outputStr.strip()
    return outputStr

